package com.itheima.io.fileinputstream.demo01;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class FileInputStreamDemo01 {

    public static void main(String[] args) throws IOException {

        InputStream inputStream = new FileInputStream("itheima-io-fileinputstream\\a.text");

//        int by = -1;
//        while ((by = inputStream.read()) != -1){
//            System.out.print((char)by);
//        }

        byte[] bytes = new byte[1024];
        int len = -1;
        while ((len = inputStream.read(bytes)) != -1){
            System.out.println(new String(bytes, 0, len));
        }



        inputStream.close();

    }
}
